PUMAS round3#357
Conversation
…ns_pre' init phase.
atmos_phys0_20_000: Merge development to main (ESCOMP#345)
Fixes for PUMAS bfb with QPC7 and FHISTC_LTso CAM snapshot
|
Please note that since |
… pumas_post_main Mirrors CAM micro_pumas_cam post-call recomputation, which discards the per-substep values PUMAS returns. Match dei standard name with RRTMGP and the CAM-SIMA registry (singular crystal). Run pumas_post_main before apply_heating_rate (air density uses the pre-heating temperature) and add the low stratiform cloud fraction optics limiter to the suite.
Mirrors CAM micro_pumas_cam, including the separate meters-to-microns conversion step. Match snow diameter standard name with RRTMGP and the CAM-SIMA registry (snow_crystal).
Updates for bit-for-bit fields that interact with RRTMGP
atmos_phys0_26_000: Move ndrop_bam, nucleate_ice, and other microp_aero interstitials to atmos_phys (ESCOMP#411)
Automated code review (PR #357 — PUMAS round3)This is an AI-assisted review ( High priority
Medium priority
Low priority / for human review
Notes (not blocking)
|
nusbaume
left a comment
There was a problem hiding this comment.
Thanks for getting all of the required interstitials set up @cacraigucar and @jimmielin! I have some comments and change requests, but I believe many should either be easy to fix, or can just be pushed off onto future work issues (including the standard name requests). Of course if you have any questions or concerns just let me know!
|
|
||
| !CCPP error handling: | ||
| character(len=*), intent(out) :: errmsg | ||
| integer, intent(out) :: errcode |
There was a problem hiding this comment.
Fix indentation here to better align with the code above?
| integer, intent(out) :: errcode | |
| integer, intent(out) :: errcode |
| !Host model dimensions/parameters: | ||
| integer, intent(in) :: ncol | ||
| integer, intent(in) :: nlev | ||
| integer, intent(in) :: nlevp1 | ||
| integer, intent(in) :: trop_cloud_top_lev !Index of the top model level for which | ||
| !cloud physics is applied (1 to nlev) | ||
|
|
||
| !PUMAS dimensions/parameters: | ||
| integer, intent(in) :: micro_ncol !Number of horizontal microphysics columns (count) | ||
| integer, intent(in) :: micro_nlev !Number of microphysics vertical layers (count) | ||
| integer, intent(in) :: micro_nlevp1 !Number of microphysics vertical interfaces (count) | ||
| integer, intent(in) :: micro_dust_nbins !Number of dust bins |
There was a problem hiding this comment.
It looks like most of these variables aren't used in this subroutine, so I think this can be cleaned up to be the following:
| !Host model dimensions/parameters: | |
| integer, intent(in) :: ncol | |
| integer, intent(in) :: nlev | |
| integer, intent(in) :: nlevp1 | |
| integer, intent(in) :: trop_cloud_top_lev !Index of the top model level for which | |
| !cloud physics is applied (1 to nlev) | |
| !PUMAS dimensions/parameters: | |
| integer, intent(in) :: micro_ncol !Number of horizontal microphysics columns (count) | |
| integer, intent(in) :: micro_nlev !Number of microphysics vertical layers (count) | |
| integer, intent(in) :: micro_nlevp1 !Number of microphysics vertical interfaces (count) | |
| integer, intent(in) :: micro_dust_nbins !Number of dust bins | |
| !Host model dimensions/parameters: | |
| integer, intent(in) :: ncol | |
| integer, intent(in) :: trop_cloud_top_lev !Index of the top model level for which | |
| !cloud physics is applied (1 to nlev) |
| use pumas_kinds, only: pumas_r8=>kind_r8 | ||
| use ccpp_kinds, only: kind_phys |
There was a problem hiding this comment.
This should have been caught by the AI, but can we move these use statements down to the relevant subroutine level?
| advected = true | ||
| [pumas_cldliq] | ||
| standard_name = pumas_cloud_liquid_water_mixing_ratio_wrt_moist_air_and_condensed_water | ||
| long_name = microphysics cloud liquid wrt moist air and condensed water of new state |
There was a problem hiding this comment.
I might add "mixing ratio" to the long name here:
| long_name = microphysics cloud liquid wrt moist air and condensed water of new state | |
| long_name = microphysics cloud liquid mixing ratio wrt moist air and condensed water of new state |
| [pumas_frzimm] | ||
| standard_name = tendency_of_pumas_cloud_liquid_droplet_number_concentration_due_to_immersion_freezing | ||
| long_name = microphysics tendency of cloud liquid droplet number concentration due to immersion freezing | ||
| units = cm-3 |
There was a problem hiding this comment.
I am not sure why I didn't catch this earlier, but essentially by definition a variable that is a tendency_of_X must have a s-1 term in the units, which it looks like the three frz variables listed here don't have.
I wouldn't worry about it for this PR, but it might be good to create an issue pointing out this discrepency, as it could potentially indicate either a science bug or an incorrect description of what the variable actually is.
There was a problem hiding this comment.
Just a note to feel free to assign this issue to me as I will deal with the units when CCPPizing hetfrz_classnuc eventually, beyond the MAM work.
| @@ -0,0 +1,1206 @@ | |||
| [ccpp-table-properties] | |||
| name = micro_pumas_ccpp_dimensions_post | |||
| type = scheme | |||
There was a problem hiding this comment.
Don't we need a dependencies and kind_spec attribute here?
| type = scheme | |
| type = scheme | |
| dependencies = pumas/pumas_kinds.F90 | |
| kind_spec = pumas_kinds:pumas_r8=>kind_r8 |
| kind = pumas_r8 | ||
| intent = in | ||
| [numice_tend] | ||
| standard_name = tendency_of_mass_number_concentration_of_ice_wrt_moist_air_and_condensed_water |
There was a problem hiding this comment.
I believe this should say cloud_ice_water_crystals:
| standard_name = tendency_of_mass_number_concentration_of_ice_wrt_moist_air_and_condensed_water | |
| standard_name = tendency_of_mass_number_concentration_of_cloud_ice_water_crystals_wrt_moist_air_and_condensed_water |
| rho(:,:) = real(pmid(:ncol,:), pumas_r8) / & | ||
| (real(rair, pumas_r8) * real(temp(:ncol,:), pumas_r8)) | ||
| icwmrst(:,:) = min(real(cldliq(:ncol,:), pumas_r8) / & | ||
| max(mincld, real(strat_cldfrc(:ncol,:), pumas_r8)), 0.005_pumas_r8) | ||
| ncic(:,:) = real(numliq(:ncol,:), pumas_r8) / & | ||
| max(mincld, real(strat_cldfrc(:ncol,:), pumas_r8)) | ||
|
|
||
| mu(:,:) = 0._pumas_r8 | ||
| lambdac(:,:) = 0._pumas_r8 | ||
| do k = trop_cloud_top_lev, nlev | ||
| call size_dist_param_liq(mg_liq_props, icwmrst(:,k), ncic(:,k), rho(:,k), & | ||
| mu(:,k), lambdac(:,k), ncol) | ||
| end do |
There was a problem hiding this comment.
There might be a science bug here, in that the rho is calculated using the dry air gas constant and regular temperature (but the full pressure), and is then being used to convert the value of various mass number concentration variables (like ncic), which is with respect to the mass of moist air and condensed water. I obviously wouldn't worry about fixing it here, but might be worth opening an issue so that we can double-check it in the future?
Also pinging @PeterHjortLauritzen in case I am totally wrong here.
There was a problem hiding this comment.
Just a note that I think this bug belongs to ESCOMP/PUMAS.
The post-interstitial rho is consistent with the one inside micro_pumas_v1.F90
rho(i,k) = p(i,k)/(r*t(i,k))p here is also pmid, r is rair
The rho cancels out in des and degrau, I think, so it's just pgam and lamc.
If a fix is made it should be in PUMAS then the downstream interstitials are adjusted to remain consistent. This would introduce answer changes everywhere, though.
| type = scheme | ||
| dependencies = pumas/micro_pumas_utils.F90 |
There was a problem hiding this comment.
Do we need the kind-related dependencies here as well?
| type = scheme | |
| dependencies = pumas/micro_pumas_utils.F90 | |
| type = scheme | |
| dependencies = pumas/micro_pumas_utils.F90 | |
| dependencies = pumas/pumas_kinds.F90 | |
| kind_spec = pumas_kinds:pumas_r8=>kind_r8 |
| intent = in | ||
| advected = true | ||
| [numice] | ||
| standard_name = mass_number_concentration_of_ice_wrt_moist_air_and_condensed_water |
There was a problem hiding this comment.
I believe this should be cloud_ice_water_crystals here:
| standard_name = mass_number_concentration_of_ice_wrt_moist_air_and_condensed_water | |
| standard_name = mass_number_concentration_of_cloud_ice_water_crystals_wrt_moist_air_and_condensed_water |
Originator(s): cacraigucar, nusbaume, billsacks, peverwhee, I-Kuan Hu, jimmielin
Description (include issue title and the keyword ['closes', 'fixes', 'resolves'] and issue number):
List all namelist files that were added or changed:
A schemes/pumas/pumas_pre_main_namelist.xml
- pumas CAM-SIMA namelist generator
List all files eliminated and why: N/A
List all files added and what they do:
A schemes/pumas/micro_pumas_ccpp_dimensions_post.F90
A schemes/pumas/micro_pumas_ccpp_dimensions_post.meta
A schemes/pumas/micro_pumas_ccpp_dimensions_pre.F90
A schemes/pumas/micro_pumas_ccpp_dimensions_pre.meta
- code which subsets and converts to pumas_r8 and back
A schemes/pumas/pumas_pre_main.F90
A schemes/pumas/pumas_pre_main.meta
A schemes/pumas/pumas_post_main.F90
A schemes/pumas/pumas_post_main.meta
- placeholder for interstitial schemes
A schemes/sima_diagnostics/pumas_diagnostics.F90
A schemes/sima_diagnostics/pumas_diagnostics_calling.F90
A schemes/sima_diagnostics/pumas_diagnostics.F90-keep_for_run
- These are being included even though they are only partially complete - NO REVIEW IS BEING DONE NOW
A test/test_suites/suite_pumas.xml
- test suite for PUMAS
A schemes/microp_aero/ccpp/hetfrz_classnuc_stub.F90
A schemes/microp_aero/ccpp/hetfrz_classnuc_stub.meta
A schemes/microp_aero/ccpp/hetfrz_classnuc_stub_namelist.xml
- stub for hetfrz_classnuc to provide the namelist option do_hetfrz_classnuc used by PUMAS core (micro_pumas_ccpp)
A schemes/pumas/micro_pumas_ccpp_optics_limiter.F90
A schemes/pumas/micro_pumas_ccpp_optics_limiter.meta
- optics property limiter for strat_cldfrc<cldfrc_min copied from micro_pumas_cam
A schemes/utilities/clamp_number_concentrations.F90
A schemes/utilities/clamp_number_concentrations.meta
- clamp number concentrations to 1e-12, 1e10 range the same as CAM physics types
A test/test_schemes/clubb_stub.F90
A test/test_schemes/clubb_stub.meta
List all existing files that have been modified, and describe the changes:
(Helpful git command:
git diff --name-status development...<your_branch_name>)M .gitmodules
M doc/NamesNotInDictionary.txt
M schemes/pumas/pumas
M schemes/rasch_kristjansson/rk_stratiform.F90
M schemes/rasch_kristjansson/rk_stratiform.meta
M schemes/rrtmgp/rrtmgp_lw_cloud_optics.meta
M schemes/rrtmgp/rrtmgp_sw_cloud_optics.meta
M schemes/sima_diagnostics/rk_stratiform_diagnostics.F90
M schemes/sima_diagnostics/rk_stratiform_diagnostics.meta
M test/test_schemes/initialize_constituents.F90
- updated standard names
List all automated tests that failed, as well as an explanation for why they weren't fixed:
Is this an answer-changing PR? If so, is it a new physics package, algorithm change, tuning change, etc?
- new capability in CAM-SIMA
If yes to the above question, describe how this code was validated with the new/modified features: